package com.itfitness.licenseocrdemo.utils;

import android.graphics.Bitmap;

/**
 * @ProjectName: CameraView
 * @Package: com.itfitness.cameraview.utils
 * @ClassName: CardNumberUtils
 * @Description: java类作用描述 ：
 * @Author: 作者名：lml
 * @CreateDate: 2019/3/5 12:21
 * @UpdateUser: 更新者：
 * @UpdateDate: 2019/3/5 12:21
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */

public class CardUtil {

    /**
     * 裁剪身份证区域
     * @param bitmap
     * @return
     */
    public static Bitmap clipCardNumber(Bitmap bitmap){
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        int clipX = 0;
        int clipY = height/2;
        return Bitmap.createBitmap(bitmap,clipX,clipY,width,height/2);
    }

    /**
     * 将图像二值化
     * @param bitmap
     */
    public native static void binaryBitmap(Bitmap bitmap);
}
